<div class="mini-toolbar" style="text-align:center;line-height:30px;" borderStyle="border:0;">
	<label>名称：</label>
	<input id="key" class="mini-textbox" style="width:100px;" onenter="onKeyEnter"/>
	<label>类型：</label>
	<input id="types" class="mini-combobox" textField="name" valueField="name" data="JS.CONST[3]" allowInput="true" style="width:90px;" onenter="onKeyEnter"/>
	<label>品牌：</label>
	<input id="brand" class="mini-combobox" textField="name" valueField="name" allowInput="true" style="width:90px;" onenter="onKeyEnter"/>
	<label>型号：</label>
	<input id="pattern" class="mini-combobox" textField="name" valueField="name" allowInput="true" style="width:90px;" onenter="onKeyEnter"/>
	<a class="mini-button" style="width:60px;" onclick="search()">查询...</a>
</div>
<div class="mini-fit">
	<div id="grid1" class="mini-datagrid" style="width:100%;height:100%;" idField="id" allowResize="false" borderStyle="border-left:0;border-right:0;" onrowdblclick="onRowDblClick" url="/common/Devicedata" >
		<div property="columns">
			<div type="indexcolumn"></div>
			<div field="name" width="100">名称</div>
			<div field="types" width="100">类型</div>
			<div field="brand" width="100">品牌</div>
			<div field="pattern" width="100">型号</div>
			<div field="updated" dateFormat="yyyy-MM-dd" width="100">时间</div>
		</div>
	</div>
</div>
<div class="mini-toolbar" style="text-align:center;padding-top:8px;padding-bottom:8px;" borderStyle="border:0;">
	<a class="mini-button" style="width:60px;" onclick="onOk()">确定</a>
	<span style="display:inline-block;width:25px;"></span>
	<a class="mini-button" style="width:60px;" onclick="onCancel()">取消</a>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("grid1");
grid.load();

//咨询投诉区分
mini.get("types").on("valuechanged",function(e){
	mini.get("brand").load("/common/deviceBrand?types=" + mini.get("types").getValue());
});

mini.get("brand").on("valuechanged",function(e){
	mini.get("pattern").load("/common/devicePattern?types=" + mini.get("types").getValue() + "&brand=" + mini.get("brand").getValue());
});

function GetData() {
    var row = grid.getSelected();
    return row;
}
function search() {
    grid.load({key:mini.get("key").getValue(),types:mini.get("types").getValue(),brand:mini.get("brand").getValue(),pattern:mini.get("pattern").getValue()});
}
function onKeyEnter(e) {
    search();
}
function onRowDblClick(e) {
    onOk();
}
//////////////////////////////////
function CloseWindow(action) {
    if (window.CloseOwnerWindow){
        return window.CloseOwnerWindow(action);
    }else{
        window.close();
    }
}

function onOk() {
    CloseWindow("ok");
}
function onCancel() {
    CloseWindow("cancel");
}
</script>